#include <iostream>
#include <string>
#include "alignment.h"
#include "MbRandom.h"
#include "model.h"
#include "settings.h"
//#include "mpi.h"
#include <ctime>

using namespace std;



int main (int argc, char *argv[]) {

	//double start1, finish1,start, finish, time;
	clock_t start1, finish1,start, finish;
	double time;
	
	//start1 = MPI::Wtime();
	start1 = clock();	
	/* get user settings, either from the command line
	   arguments or from a series of prompts */
	Settings mySettings(argc, argv);
	
	/* instantiate the random number class */
	MbRandom myRandom;
	
	/* read in the alignment */
	Alignment myAlignment( mySettings.getDataFileName() );
	myAlignment.compress();
	//myAlignment.print();
	
	/* set up the phylogenetic model */
	//start = MPI::Wtime();
	//MPI::Init(argc, argv);
	start = clock();	
	Model myModel(&myAlignment, &myRandom, &mySettings);
	finish = clock();
	time = (double(finish)-double(start))/CLOCKS_PER_SEC;
	//finish = MPI::Wtime();
	//time = (finish - start);
	cout << "Setup Time is " << time <<" secs" << endl;
	
	//start = MPI::Wtime();
	start = clock();	
	cout << "lnL = " << myModel.calculateLikelihood() << endl;
	//finish = MPI::Wtime();
	//time = (finish - start);
	finish = clock();
	time = (double(finish)-double(start))/CLOCKS_PER_SEC;
	cout << "Calc Time is " << time <<" secs" << endl;

	//finish1 = MPI::Wtime();
	//time = (finish1 - start1);
	finish1 = clock();
	time = (double(finish1)-double(start1))/CLOCKS_PER_SEC;
	cout << "Total Time is " << time <<" secs" << endl;

	//MPI::Finalize();

    return 0;
	
}
